import request from '@/utils/request';
import { rsaEncrypt } from '@/utils/commonUtil3';

// 门店管理
// 获取门店列表
export function getShopEasy(data) {
	return request({
		url: '/member/selectList',
		method: 'get',
		params: data
	});
}

// 获取会员列表
export function getMemberList(data) {
	return request({
		url: '/member/select',
		method: 'get',
		params: data
	});
}

// 删除会员
export function delMember(data) {
	const data1 = rsaEncrypt(data);
	return request({
		url: '/member/delete',
		method: 'delete',
		data: {
			data: data1
		}
	});
}

// 获取会员详细信息
export function getMembeDetail(data) {
	return request({
		url: '/member/selectDetails',
		method: 'get',
		params: data
	});
}

// 获取收银机列表
export function getPosList(data) {
	return request({
		url: '/cashier/select',
		method: 'get',
		params: data
	});
}

// 获取收银机详情
export function getPosDetail(data) {
	return request({
		url: '/cashier/select/details',
		method: 'get',
		params: data
	});
}

// 修改收银机
export function updatePosDetail(data) {
	const data1 = rsaEncrypt(data);
	return request({
		url: '/cashier/update',
		method: 'put',
		data: {
			data: data1
		}
	});
}

// 新增收银机
export function addPos(data) {
	const data1 = rsaEncrypt(data);
	return request({
		url: '/cashier/insert',
		method: 'post',
		data: {
			data: data1
		}
	});
}

// 分页条件查找门店AI激活码
export function getShopAiCode(data) {
	return request({
		url: '/aiCode/select',
		method: 'get',
		params: data
	});
}

// 添加门店AI激活码
export function addShopAiCode(data) {
	const data1 = rsaEncrypt(data);
	return request({
		url: '/aiCode/insert',
		method: 'post',
		data: {
			data: data1
		}
	});
}

// 获取门店AI激活码详情
export function getShopAiCodeDetail(data) {
	return request({
		url: '/aiCode/selectById',
		method: 'get',
		params: data
	});
}

// 门店AI激活码绑定设备
export function bindShopAiCode(data) {
	const data1 = rsaEncrypt(data);
	return request({
		url: '/aiCode/update',
		method: 'put',
		data: {
			data: data1
		}
	});
}

//删除门店AI激活码
export function delShopAiCode(data) {
	const data1 = rsaEncrypt(data);
	return request({
		url: '/aiCode/delete',
		method: 'delete',
		data: {
			data: data1
		}
	});
}

// 获取收银设备列表 -- 绑定激活码
export function getPosBindCodeList(data) {
	return request({
		url: '/aiCode/selectCashierList',
		method: 'get',
		params: data
	});
}

// 异常交班
export function exceptionShift(data) {
	const data1 = rsaEncrypt(data);
	return request({
		url: '/handover/handleError',
		method: 'post',
		data: {
			data: data1
		}
	});
}

// 获取用户提现记录
export function getWithdrawRecord(data) {
	return request({
		url: '/member/getCash',
		method: 'get',
		params: data
	});
}

// 获取用户通证兑换记录
export function getExchangeRecord(data) {
	return request({
		url: '/member/getTokenOrder',
		method: 'get',
		params: data
	});
}

// 通证发放记录
export function getIssueRecord(data) {
	return request({
		url: '/member/distribution/records',
		method: 'get',
		params: data
	});
}

// 禁用会员
export function disableMember(data) {
	const data1 = rsaEncrypt(data);
	return request({
		url: '/member/disable',
		method: 'post',
		data: {
			data: data1
		}
	});
}

// 解除异常
export function relieveAbnormal(data) {
	const data1 = rsaEncrypt(data);
	return request({
		url: '/member/manageException',
		method: 'post',
		data: {
			data: data1
		}
	});
}

//  查询公司数据大屏后台系统配置
export function getCompanyConfig(data) {
	return request({
		url: '/screenSetting/selectCompanyInfo',
		method: 'get',
		params: data
	});
}

// 修改公司数据大屏基础数据
export function updateCompanyConfig(data) {
	const data1 = rsaEncrypt(data);
	return request({
		url: '/screenSetting/updateCompanyInfo',
		method: 'put',
		data: {
			data: data1
		}
	});
}
